package com.teziyou.commodity.enumtype;

public enum EnableEnum {
	
	ON(1, "启用"),
	OFF(0, "禁用");

	private int code;
	private String desc;
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	private EnableEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static EnableEnum getEnumByCode(int code) {
		EnableEnum[] enums = EnableEnum.values();
		for(EnableEnum enumtype:enums) {
			if(code==enumtype.getCode()) return enumtype;
		}
		return null;
	}
}
